<script setup>
import {onMounted, ref} from "vue";
import {showSider,activeKey} from "@/views/HomeView_N.vue";


onMounted(() => {
  showSider.value = true;
  activeKey.value = 'rider-homepage';
})

</script>
<script>
import {showSider} from "@/views/HomeView_N.vue";
import {ref} from "vue";

const loginUser = ref(getUser());
export default {
  beforeRouteEnter(to, from,next) {
    if (loginUser.value.level == 10) {
      console.log(to);
      next('/become');
    }else {
      next();
    }
  },
  // 组件内的钩子函数
  beforeRouteLeave(to, from, next) {
    // 在离开当前路由时进行一些操作
    showSider.value = false;
    next();
  }
}
</script>

<template>
  <n-layout has-sider>
<!--    内容区域-->
    <n-layout content-style="padding: 24px;" style="padding: 0 80px" :native-scrollbar="false">
      <router-view/>
    </n-layout>
  </n-layout>
</template>

<style scoped>

</style>